﻿using Decoration.IRepository;
using Decoration.IService;
using Decoration.Models.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Decoration.Service
{
    public class OrderDetailService : BaseService<OrderDetail>, IOrderDetailService
    {
        private readonly IOrderDetailRepository rep;

        public OrderDetailService(IOrderDetailRepository rep, IBaseQueryRepository brep) : base(rep, brep)
        {
            this.rep = rep;
        }

        public bool AddRange(IEnumerable<OrderDetail> list)
        {
            foreach (var item in list)
            {
                rep.Add(item);
            }

            return rep.SaveChanges();
        }
    }
}
